import { Global, Logger, Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';

import { AuthModule } from './auth/auth.module';
import { DepartmentModule } from './department/department.module';
import { MajorModule } from './major/major.module';
import { CourseModule } from './course/course.module';
import { StudentModule } from './student/student.module';
import { RolesModule } from './roles/roles.module';
import { MenusModule } from './menus/menus.module';

import configCuration from './configCuration';
import { connectionParams } from '../ormconfig';
import { LogsModule } from './logs/logs.module';
import { ClassInfoModule } from './class-info/class-info.module';
import { TeacherModule } from './teacher/teacher.module';
import { SystemUserModule } from './system-user/system-user.module';
import { LessonsSortModule } from './lessons-sort/lessons-sort.module';
import { PublicityModule } from './publicity/publicity.module';
import { StudentCourseModule } from './student-course/student-course.module';
import { ClassRoomsModule } from './class-rooms/class-rooms.module';
import { TimeSlotsModule } from './time-slots/time-slots.module';
import { CommonModule } from './common/common.module';

@Global()
@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      load: [configCuration],
    }),
    TypeOrmModule.forRoot(connectionParams),
    AuthModule,
    DepartmentModule,
    MajorModule,
    CourseModule,
    StudentModule,
    RolesModule,
    MenusModule,
    LogsModule,
    ClassInfoModule,
    TeacherModule,
    SystemUserModule,
    LessonsSortModule,
    PublicityModule,
    StudentCourseModule,
    ClassRoomsModule,
    TimeSlotsModule,
    CommonModule,
  ],
  controllers: [],
  providers: [Logger],
  exports: [Logger],
})
export class AppModule {}
